/*
 * Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <tencentcloud/yunjing/v20180228/model/Malware.h>

using TencentCloud::CoreInternalOutcome;
using namespace TencentCloud::Yunjing::V20180228::Model;
using namespace rapidjson;
using namespace std;

Malware::Malware() :
    m_idHasBeenSet(false),
    m_machineIpHasBeenSet(false),
    m_statusHasBeenSet(false),
    m_filePathHasBeenSet(false),
    m_descriptionHasBeenSet(false),
    m_machineNameHasBeenSet(false),
    m_fileCreateTimeHasBeenSet(false),
    m_modifyTimeHasBeenSet(false),
    m_uuidHasBeenSet(false)
{
}

CoreInternalOutcome Malware::Deserialize(const Value &value)
{
    string requestId = "";


    if (value.HasMember("Id") && !value["Id"].IsNull())
    {
        if (!value["Id"].IsUint64())
        {
            return CoreInternalOutcome(Error("response `Malware.Id` IsUint64=false incorrectly").SetRequestId(requestId));
        }
        m_id = value["Id"].GetUint64();
        m_idHasBeenSet = true;
    }

    if (value.HasMember("MachineIp") && !value["MachineIp"].IsNull())
    {
        if (!value["MachineIp"].IsString())
        {
            return CoreInternalOutcome(Error("response `Malware.MachineIp` IsString=false incorrectly").SetRequestId(requestId));
        }
        m_machineIp = string(value["MachineIp"].GetString());
        m_machineIpHasBeenSet = true;
    }

    if (value.HasMember("Status") && !value["Status"].IsNull())
    {
        if (!value["Status"].IsString())
        {
            return CoreInternalOutcome(Error("response `Malware.Status` IsString=false incorrectly").SetRequestId(requestId));
        }
        m_status = string(value["Status"].GetString());
        m_statusHasBeenSet = true;
    }

    if (value.HasMember("FilePath") && !value["FilePath"].IsNull())
    {
        if (!value["FilePath"].IsString())
        {
            return CoreInternalOutcome(Error("response `Malware.FilePath` IsString=false incorrectly").SetRequestId(requestId));
        }
        m_filePath = string(value["FilePath"].GetString());
        m_filePathHasBeenSet = true;
    }

    if (value.HasMember("Description") && !value["Description"].IsNull())
    {
        if (!value["Description"].IsString())
        {
            return CoreInternalOutcome(Error("response `Malware.Description` IsString=false incorrectly").SetRequestId(requestId));
        }
        m_description = string(value["Description"].GetString());
        m_descriptionHasBeenSet = true;
    }

    if (value.HasMember("MachineName") && !value["MachineName"].IsNull())
    {
        if (!value["MachineName"].IsString())
        {
            return CoreInternalOutcome(Error("response `Malware.MachineName` IsString=false incorrectly").SetRequestId(requestId));
        }
        m_machineName = string(value["MachineName"].GetString());
        m_machineNameHasBeenSet = true;
    }

    if (value.HasMember("FileCreateTime") && !value["FileCreateTime"].IsNull())
    {
        if (!value["FileCreateTime"].IsString())
        {
            return CoreInternalOutcome(Error("response `Malware.FileCreateTime` IsString=false incorrectly").SetRequestId(requestId));
        }
        m_fileCreateTime = string(value["FileCreateTime"].GetString());
        m_fileCreateTimeHasBeenSet = true;
    }

    if (value.HasMember("ModifyTime") && !value["ModifyTime"].IsNull())
    {
        if (!value["ModifyTime"].IsString())
        {
            return CoreInternalOutcome(Error("response `Malware.ModifyTime` IsString=false incorrectly").SetRequestId(requestId));
        }
        m_modifyTime = string(value["ModifyTime"].GetString());
        m_modifyTimeHasBeenSet = true;
    }

    if (value.HasMember("Uuid") && !value["Uuid"].IsNull())
    {
        if (!value["Uuid"].IsString())
        {
            return CoreInternalOutcome(Error("response `Malware.Uuid` IsString=false incorrectly").SetRequestId(requestId));
        }
        m_uuid = string(value["Uuid"].GetString());
        m_uuidHasBeenSet = true;
    }


    return CoreInternalOutcome(true);
}

void Malware::ToJsonObject(Value &value, Document::AllocatorType& allocator) const
{

    if (m_idHasBeenSet)
    {
        Value iKey(kStringType);
        string key = "Id";
        iKey.SetString(key.c_str(), allocator);
        value.AddMember(iKey, m_id, allocator);
    }

    if (m_machineIpHasBeenSet)
    {
        Value iKey(kStringType);
        string key = "MachineIp";
        iKey.SetString(key.c_str(), allocator);
        value.AddMember(iKey, Value(m_machineIp.c_str(), allocator).Move(), allocator);
    }

    if (m_statusHasBeenSet)
    {
        Value iKey(kStringType);
        string key = "Status";
        iKey.SetString(key.c_str(), allocator);
        value.AddMember(iKey, Value(m_status.c_str(), allocator).Move(), allocator);
    }

    if (m_filePathHasBeenSet)
    {
        Value iKey(kStringType);
        string key = "FilePath";
        iKey.SetString(key.c_str(), allocator);
        value.AddMember(iKey, Value(m_filePath.c_str(), allocator).Move(), allocator);
    }

    if (m_descriptionHasBeenSet)
    {
        Value iKey(kStringType);
        string key = "Description";
        iKey.SetString(key.c_str(), allocator);
        value.AddMember(iKey, Value(m_description.c_str(), allocator).Move(), allocator);
    }

    if (m_machineNameHasBeenSet)
    {
        Value iKey(kStringType);
        string key = "MachineName";
        iKey.SetString(key.c_str(), allocator);
        value.AddMember(iKey, Value(m_machineName.c_str(), allocator).Move(), allocator);
    }

    if (m_fileCreateTimeHasBeenSet)
    {
        Value iKey(kStringType);
        string key = "FileCreateTime";
        iKey.SetString(key.c_str(), allocator);
        value.AddMember(iKey, Value(m_fileCreateTime.c_str(), allocator).Move(), allocator);
    }

    if (m_modifyTimeHasBeenSet)
    {
        Value iKey(kStringType);
        string key = "ModifyTime";
        iKey.SetString(key.c_str(), allocator);
        value.AddMember(iKey, Value(m_modifyTime.c_str(), allocator).Move(), allocator);
    }

    if (m_uuidHasBeenSet)
    {
        Value iKey(kStringType);
        string key = "Uuid";
        iKey.SetString(key.c_str(), allocator);
        value.AddMember(iKey, Value(m_uuid.c_str(), allocator).Move(), allocator);
    }

}


uint64_t Malware::GetId() const
{
    return m_id;
}

void Malware::SetId(const uint64_t& _id)
{
    m_id = _id;
    m_idHasBeenSet = true;
}

bool Malware::IdHasBeenSet() const
{
    return m_idHasBeenSet;
}

string Malware::GetMachineIp() const
{
    return m_machineIp;
}

void Malware::SetMachineIp(const string& _machineIp)
{
    m_machineIp = _machineIp;
    m_machineIpHasBeenSet = true;
}

bool Malware::MachineIpHasBeenSet() const
{
    return m_machineIpHasBeenSet;
}

string Malware::GetStatus() const
{
    return m_status;
}

void Malware::SetStatus(const string& _status)
{
    m_status = _status;
    m_statusHasBeenSet = true;
}

bool Malware::StatusHasBeenSet() const
{
    return m_statusHasBeenSet;
}

string Malware::GetFilePath() const
{
    return m_filePath;
}

void Malware::SetFilePath(const string& _filePath)
{
    m_filePath = _filePath;
    m_filePathHasBeenSet = true;
}

bool Malware::FilePathHasBeenSet() const
{
    return m_filePathHasBeenSet;
}

string Malware::GetDescription() const
{
    return m_description;
}

void Malware::SetDescription(const string& _description)
{
    m_description = _description;
    m_descriptionHasBeenSet = true;
}

bool Malware::DescriptionHasBeenSet() const
{
    return m_descriptionHasBeenSet;
}

string Malware::GetMachineName() const
{
    return m_machineName;
}

void Malware::SetMachineName(const string& _machineName)
{
    m_machineName = _machineName;
    m_machineNameHasBeenSet = true;
}

bool Malware::MachineNameHasBeenSet() const
{
    return m_machineNameHasBeenSet;
}

string Malware::GetFileCreateTime() const
{
    return m_fileCreateTime;
}

void Malware::SetFileCreateTime(const string& _fileCreateTime)
{
    m_fileCreateTime = _fileCreateTime;
    m_fileCreateTimeHasBeenSet = true;
}

bool Malware::FileCreateTimeHasBeenSet() const
{
    return m_fileCreateTimeHasBeenSet;
}

string Malware::GetModifyTime() const
{
    return m_modifyTime;
}

void Malware::SetModifyTime(const string& _modifyTime)
{
    m_modifyTime = _modifyTime;
    m_modifyTimeHasBeenSet = true;
}

bool Malware::ModifyTimeHasBeenSet() const
{
    return m_modifyTimeHasBeenSet;
}

string Malware::GetUuid() const
{
    return m_uuid;
}

void Malware::SetUuid(const string& _uuid)
{
    m_uuid = _uuid;
    m_uuidHasBeenSet = true;
}

bool Malware::UuidHasBeenSet() const
{
    return m_uuidHasBeenSet;
}

